package rad.framework.mda.generator.template.maven;

import org.eclipse.uml2.uml.Model;
import rad.framework.mda.generator.util.*;

public class SunEclipseCheckStyle
{
  protected static String nl;
  public static synchronized SunEclipseCheckStyle create(String lineSeparator)
  {
    nl = lineSeparator;
    SunEclipseCheckStyle result = new SunEclipseCheckStyle();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "<?xml version=\"1.0\"?>" + NL + "<!DOCTYPE module PUBLIC" + NL + "    \"-//Puppy Crawl//DTD Check Configuration 1.2//EN\"" + NL + "    \"http://www.puppycrawl.com/dtds/configuration_1_2.dtd\">" + NL + "" + NL + "<!--" + NL + "" + NL + "  Checkstyle configuration that checks the sun coding conventions from:" + NL + "" + NL + "    - the Java Language Specification at" + NL + "      http://java.sun.com/docs/books/jls/second_edition/html/index.html" + NL + "" + NL + "    - the Sun Code Conventions at http://java.sun.com/docs/codeconv/" + NL + "" + NL + "    - the Javadoc guidelines at" + NL + "      http://java.sun.com/j2se/javadoc/writingdoccomments/index.html" + NL + "" + NL + "    - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html" + NL + "" + NL + "    - some best practices" + NL + "" + NL + "  Checkstyle is very configurable. Be sure to read the documentation at" + NL + "  http://checkstyle.sf.net (or in your downloaded distribution)." + NL + "" + NL + "  Most Checks are configurable, be sure to consult the documentation." + NL + "" + NL + "  To completely disable a check, just comment it out or delete it from the file." + NL + "" + NL + "  Finally, it is worth reading the documentation." + NL + "" + NL + "-->" + NL + "" + NL + "<module name=\"Checker\">" + NL + "\t<property name=\"severity\" value=\"warning\"/>" + NL + "" + NL + "    <!-- Checks that a package.html file exists for each package.     -->" + NL + "    <!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml -->" + NL + "    <module name=\"PackageHtml\"/>" + NL + "" + NL + "    <!-- Checks whether files end with a new line.                        -->" + NL + "    <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->" + NL + "    <module name=\"NewlineAtEndOfFile\"/>" + NL + "" + NL + "    <!-- Checks that property files contain the same keys.         -->" + NL + "    <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->" + NL + "    <module name=\"Translation\"/>" + NL + "" + NL + "" + NL + "    <module name=\"TreeWalker\">" + NL + "        <property name=\"tabWidth\" value=\"4\"/>" + NL + "" + NL + "        <!-- Checks for Javadoc comments.                     -->" + NL + "        <!-- See http://checkstyle.sf.net/config_javadoc.html -->" + NL + "        <module name=\"JavadocMethod\">" + NL + "            <property name=\"logLoadErrors\" value=\"true\"/>" + NL + "            <property name=\"suppressLoadErrors\" value=\"true\"/>" + NL + "        </module>" + NL + "        <module name=\"JavadocType\"/>" + NL + "        <module name=\"JavadocVariable\"/>" + NL + "        <module name=\"JavadocStyle\"/>" + NL + "" + NL + "" + NL + "        <!-- Checks for Naming Conventions.                  -->" + NL + "        <!-- See http://checkstyle.sf.net/config_naming.html -->" + NL + "        <module name=\"ConstantName\"/>" + NL + "        <module name=\"LocalFinalVariableName\"/>" + NL + "        <module name=\"LocalVariableName\"/>" + NL + "        <module name=\"MemberName\"/>" + NL + "        <module name=\"MethodName\"/>" + NL + "        <module name=\"PackageName\"/>" + NL + "        <module name=\"ParameterName\"/>" + NL + "        <module name=\"StaticVariableName\"/>" + NL + "        <module name=\"TypeName\"/>" + NL + "" + NL + "" + NL + "        <!-- Checks for Headers                                -->" + NL + "        <!-- See http://checkstyle.sf.net/config_header.html   -->" + NL + "        <!-- <module name=\"Header\">                            -->" + NL + "            <!-- The follow property value demonstrates the ability     -->" + NL + "            <!-- to have access to ANT properties. In this case it uses -->" + NL + "            <!-- the ${basedir} property to allow Checkstyle to be run  -->" + NL + "            <!-- from any directory within a project. See property      -->" + NL + "            <!-- expansion,                                             -->" + NL + "            <!-- http://checkstyle.sf.net/config.html#properties        -->" + NL + "            <!-- <property                                              -->" + NL + "            <!--     name=\"headerFile\"                                  -->" + NL + "            <!--     value=\"${basedir}/java.header\"/>                   -->" + NL + "        <!-- </module> -->" + NL + "" + NL + "        <!-- Following interprets the header file as regular expressions. -->" + NL + "        <!-- <module name=\"RegexpHeader\"/>                                -->" + NL + "" + NL + "" + NL + "        <!-- Checks for imports                              -->" + NL + "        <!-- See http://checkstyle.sf.net/config_import.html -->" + NL + "        <module name=\"AvoidStarImport\"/>" + NL + "        <module name=\"IllegalImport\"/> <!-- defaults to sun.* packages -->" + NL + "        <module name=\"RedundantImport\"/>" + NL + "        <module name=\"UnusedImports\"/>" + NL + "" + NL + "" + NL + "        <!-- Checks for Size Violations.                    -->" + NL + "        <!-- See http://checkstyle.sf.net/config_sizes.html -->" + NL + "        <module name=\"FileLength\"/>" + NL + "        <module name=\"LineLength\"/>" + NL + "        <module name=\"MethodLength\"/>" + NL + "        <module name=\"ParameterNumber\"/>" + NL + "" + NL + "" + NL + "        <!-- Checks for whitespace                               -->" + NL + "        <!-- See http://checkstyle.sf.net/config_whitespace.html -->" + NL + "        <module name=\"EmptyForIteratorPad\"/>" + NL + "        <module name=\"MethodParamPad\"/>" + NL + "        <module name=\"NoWhitespaceAfter\">" + NL + "            <property name=\"tokens\" value=\"BNOT,DEC,DOT,INC,LNOT,UNARY_MINUS,UNARY_PLUS\"/>" + NL + "        </module>" + NL + "        <module name=\"NoWhitespaceBefore\"/>" + NL + "        <module name=\"OperatorWrap\"/>" + NL + "        <module name=\"ParenPad\"/>" + NL + "        <module name=\"TypecastParenPad\"/>" + NL + "        <module name=\"TabCharacter\">" + NL + "            <property name=\"severity\" value=\"ignore\"/>" + NL + "        </module>" + NL + "        <module name=\"WhitespaceAfter\"/>" + NL + "        <module name=\"WhitespaceAround\">" + NL + "            <property name=\"tokens\" value=\"ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,EQUAL,GE,GT,LAND,LCURLY,LE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,RCURLY,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,LITERAL_ASSERT,TYPE_EXTENSION_AND,WILDCARD_TYPE\"/>" + NL + "        </module>" + NL + "" + NL + "" + NL + "        <!-- Modifier Checks                                    -->" + NL + "        <!-- See http://checkstyle.sf.net/config_modifiers.html -->" + NL + "        <module name=\"ModifierOrder\"/>" + NL + "        <module name=\"RedundantModifier\"/>" + NL + "" + NL + "" + NL + "        <!-- Checks for blocks. You know, those {}'s         -->" + NL + "        <!-- See http://checkstyle.sf.net/config_blocks.html -->" + NL + "        <module name=\"AvoidNestedBlocks\"/>" + NL + "        <module name=\"EmptyBlock\"/>" + NL + "        <module name=\"LeftCurly\"/>" + NL + "        <module name=\"NeedBraces\"/>" + NL + "        <module name=\"RightCurly\"/>" + NL + "" + NL + "" + NL + "        <!-- Checks for common coding problems               -->" + NL + "        <!-- See http://checkstyle.sf.net/config_coding.html -->" + NL + "        <module name=\"AvoidInlineConditionals\"/>" + NL + "        <module name=\"DoubleCheckedLocking\"/>    <!-- MY FAVOURITE -->" + NL + "        <module name=\"EmptyStatement\"/>" + NL + "        <module name=\"EqualsHashCode\"/>" + NL + "        <module name=\"HiddenField\"/>" + NL + "        <module name=\"IllegalInstantiation\"/>" + NL + "        <module name=\"InnerAssignment\"/>" + NL + "        <module name=\"MagicNumber\"/>" + NL + "        <module name=\"MissingSwitchDefault\"/>" + NL + "        <module name=\"RedundantThrows\">" + NL + "            <property name=\"logLoadErrors\" value=\"true\"/>" + NL + "            <property name=\"suppressLoadErrors\" value=\"true\"/>" + NL + "        </module>" + NL + "        <module name=\"SimplifyBooleanExpression\"/>" + NL + "        <module name=\"SimplifyBooleanReturn\"/>" + NL + "" + NL + "        <!-- Checks for class design                         -->" + NL + "        <!-- See http://checkstyle.sf.net/config_design.html -->" + NL + "        <module name=\"DesignForExtension\"/>" + NL + "        <module name=\"FinalClass\"/>" + NL + "        <module name=\"HideUtilityClassConstructor\"/>" + NL + "        <module name=\"InterfaceIsType\"/>" + NL + "        <module name=\"VisibilityModifier\"/>" + NL + "" + NL + "" + NL + "        <!-- Miscellaneous other checks.                   -->" + NL + "        <!-- See http://checkstyle.sf.net/config_misc.html -->" + NL + "        <module name=\"ArrayTypeStyle\"/>" + NL + "        <module name=\"FinalParameters\"/>" + NL + "        <module name=\"GenericIllegalRegexp\">" + NL + "            <property name=\"severity\" value=\"ignore\"/>" + NL + "            <property name=\"format\" value=\"\\s+$\"/>" + NL + "            <property name=\"message\" value=\"Line has trailing spaces.\"/>" + NL + "        </module>" + NL + "        <module name=\"TodoComment\">" + NL + "            <property name=\"severity\" value=\"ignore\"/>" + NL + "        </module>" + NL + "        <module name=\"UpperEll\"/>" + NL + "" + NL + "    </module>" + NL + "" + NL + "</module>";
  protected final String TEXT_2 = NL;

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    stringBuffer.append(TEXT_1);
    stringBuffer.append(TEXT_2);
    return stringBuffer.toString();
  }
}
